package com.glaciervirtualdevice.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: Sun
 * @DateTime: 2025/4/2 11:14
 * @Description:
 **/
public class StringToJSON {

    public static Map<String, String> StringToJson(String keyValueString) {
        Map<String, String> keyValueMap = new HashMap<>();
        String[] pairs = keyValueString.split(", ");
        for (String pair : pairs) {
            String[] keyValue = pair.split(": ");
            if (keyValue.length == 2) {
                keyValueMap.put(keyValue[0], keyValue[1]);
            }
        }
        return keyValueMap;
    }
}
